package com.gthncz;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class HelloController {
	
	@RequestMapping(value = {"", "/", "/hello"}, method = RequestMethod.GET)
	public String hello(@RequestParam(name = "name", required = false, defaultValue = "") String name, ModelMap model) {
		model.addAttribute("msg", "Hi " + name + " !");
		return "hello";
	}

}
